import request from "@/utils/request";
/**
 * 订单列表
 * @param {string} type - 1:商品，2：会员服务，3：自营商品,该字段必传
 */
export function getOrderBaseList(query) {
  return request({
    url: "/cms-shop/api/order-base/list",
    method: "get",
    params: query,
  });
}

// 根据id获取订单列表
export function getOrderBaseInfo(query) {
  return request({
    url: `/cms-shop/api/order-base/${query.id}`,
    method: "get",
    params: query,
  });
}

// 订单列表删除
export function delOrderBaseType(data) {
  return request({
    url: `/cms/api/order-base/${data.id}`,
    method: "delete",
  });
}
// 订单列表添加
export function addOrderBaseType(data) {
  return request({
    url: "/cms/api/order-base",
    method: "post",
    data: data,
  });
}

// 订单列表导出
export function exportOrderBaseType(query) {
  return request({
    url: `/cms/api/order-base/export`,
    method: "get",
    params: query,
  });
}

// 订单列表编辑
export function editOrderBaseType(data) {
  return request({
    url: `/cms/api/order-base`,
    method: "put",
    data: data,
  });
}

/* 订单验收 */
export function checkAndAccept(data) {
  return request({
    url: `/cms/api/order-base/check-and-accept`,
    method: "put",
    data: data,
  });
}